<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>获取 Yaf_Dispatcher 的实例</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="yaf-application.getconfig.html">« Yaf_Application::getConfig</a></li>
      <li style="float: right;"><a href="yaf-application.getlasterrormsg.html">Yaf_Application::getLastErrorMsg »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.yaf-application.html">Yaf_Application</a></li>
    <li>获取 Yaf_Dispatcher 的实例</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="yaf-application.getdispatcher" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Yaf_Application::getDispatcher</h1>
  <p class="verinfo">(Yaf &gt;=1.0.0)</p><p class="refpurpose"><span class="refname">Yaf_Application::getDispatcher</span> &mdash; <span class="dc-title">获取 Yaf_Dispatcher 的实例</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-yaf-application.getdispatcher-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Yaf_Application::getDispatcher</strong></span>(): <span class="type"><a href="class.yaf-dispatcher.html" class="type Yaf_Dispatcher">Yaf_Dispatcher</a></span></div>

  <p class="para rdfs-comment">

  </p>



 </div>


 <div class="refsect1 parameters" id="refsect1-yaf-application.getdispatcher-parameters">
  <h3 class="title">参数</h3>
  <p class="para">此函数没有参数。</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-yaf-application.getdispatcher-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-yaf-application.getdispatcher-examples">
  <h3 class="title">范例</h3>
  <div class="example" id="example-3876">
   <p><strong>示例 #1 <span class="function"><strong>Yaf_Application::getDispatcher()</strong></span>example</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$config&nbsp;</span><span style="color: #007700">=&nbsp;array(<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"application"&nbsp;</span><span style="color: #007700">=&gt;&nbsp;array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"directory"&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">realpath</span><span style="color: #007700">(</span><span style="color: #0000BB">dirname</span><span style="color: #007700">(</span><span style="color: #0000BB">__FILE__</span><span style="color: #007700">))&nbsp;.&nbsp;</span><span style="color: #DD0000">"/application"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;),<br />);<br /><br /></span><span style="color: #FF8000">/**&nbsp;Yaf_Application&nbsp;*/<br /></span><span style="color: #0000BB">$application&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">Yaf_Application</span><span style="color: #007700">(</span><span style="color: #0000BB">$config</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$application</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getDispatcher</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
   </div>

   <div class="example-contents"><p>以上例程的输出类似于：</p></div>
   <div class="example-contents screen">
<div class="cdata"><pre>
Yaf_Dispatcher Object
(
    [_router:protected] =&gt; Yaf_Router Object
        (
            [_routes:protected] =&gt; Array
                (
                    [_default] =&gt; Yaf_Route_Static Object
                        (
                        )

                )

            [_current:protected] =&gt; 
        )

    [_view:protected] =&gt; 
    [_request:protected] =&gt; Yaf_Request_Http Object
        (
            [module] =&gt; 
            [controller] =&gt; 
            [action] =&gt; 
            [method] =&gt; Cli
            [params:protected] =&gt; Array
                (
                )

            [language:protected] =&gt; 
            [_exception:protected] =&gt; 
            [_base_uri:protected] =&gt; 
            [uri:protected] =&gt; 
            [dispatched:protected] =&gt; 
            [routed:protected] =&gt; 
        )

    [_plugins:protected] =&gt; Array
        (
        )

    [_auto_render:protected] =&gt; 1
    [_return_response:protected] =&gt; 
    [_instantly_flush:protected] =&gt; 
    [_default_module:protected] =&gt; Index
    [_default_controller:protected] =&gt; Index
    [_default_action:protected] =&gt; index
    [_response] =&gt; Yaf_Response_Cli Object
        (
            [_header:protected] =&gt; Array
                (
                )

            [_body:protected] =&gt; 
            [_sendheader:protected] =&gt; 
        )

)
</pre></div>
   </div>
  </div>
 </div>



</div></div></div></body></html>